home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / libs / pdcurs21 / portable / flash.c < prev    next >
C/C++ Source or Header  |  1993-06-18  |  2KB  |  65 lines

  1. #define    CURSES_LIBRARY    1
  2. #include <curses.h>
  3. #ifdef UNIX
  4. #include <defs.h>
  5. #include <term.h>
  6. #endif
  7. #undef    flash
  8.  
  9. #ifdef PDCDEBUG
  10. char *rcsid_flash = "$Header: C:\CURSES\portable\RCS\flash.c 2.1 1993/06/18 20:19:54 MH Rel MH $";
  11. #endif
  12.  
  13.  
  14.  
  15.  
  16. /*man-start*********************************************************************
  17.  
  18.   flash()    - generate audio-visual alarm
  19.  
  20.   X/Open Description:
  21.      This routine is used to signal the terminal user.  The beep()
  22.      function will sound the audible bell on the terminal, if possible
  23.      and if not, will flash the screen (visible bell), if possible.
  24.      The flash() function will flash the screen, and if that is not
  25.      possible, will sound the audible signal.  If neither signal is
  26.      possible, nothing will happen.  Nearly all terminals have an
  27.      audible signal (bell or beep), but only some can flash the screen.
  28.  
  29.   X/Open Return Value:
  30.      The beep() and flash() functions return OK on success and ERR on
  31.      error.
  32.  
  33.   X/Open Errors:
  34.      No errors are defined for this function.
  35.  
  36.   Portability:
  37.      PDCurses    int flash( void );
  38.      X/Open Dec '88    int flash( void );
  39.      BSD Curses    int flash( void );
  40.      SYS V Curses    int flash( void );
  41.  
  42. **man-end**********************************************************************/
  43.  
  44. int    flash(void)
  45. {
  46.     extern unsigned char atrtab[MAX_ATRTAB];
  47.     int    i;
  48.  
  49. #ifdef PDCDEBUG
  50.     if (trace_on) PDC_debug("flash() - called\n");
  51. #endif
  52.  
  53. #ifdef UNIX
  54.     if (flash_screen != NULL)
  55.         putp(flash_screen);
  56.     return(OK);
  57. #endif
  58.  
  59.     PDC_scroll(0, 0, LINES - 1, COLS - 1, 0, (chtype)(atrtab[264] << 8));
  60.     delay_output( 50 );
  61.     PDC_scroll(0, 0, LINES - 1, COLS - 1, 0, (chtype)(atrtab[265] << 8));
  62.     wrefresh(curscr);
  63.     return( OK );
  64. }
  65.